package cn.edu.gcu.lost.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@RequestMapping("user")
@Controller
public class YunUserController {

	/*
	 * 
	 
	  接口：findDeRail（）获取用户信息
	   	  1.参数：无
		  2.返回结果：	result:success||result:error---获取用户信息成功/失败
						 data :object || data :null --- 返回用户信息
	 * 
	 * 
	 */
	
	
	@ResponseBody
	@RequestMapping("findDetail")
	public Map<String,Object> findDeRail(HttpServletRequest request)
	{
		Map<String,Object>resultMap=new HashMap<String,Object>();
		if(request.getSession().getAttribute("user")==null)
		{   resultMap.put("data", null);
			resultMap.put("result", "faild");
			return resultMap;
		}
		resultMap.put("data", request.getSession().getAttribute("user"));
		resultMap.put("result","success");
		return resultMap;
	}
	
	
	
	
	
	
}
